import http from "@/utils/http";
import {EnumAlias} from "@/utils/common";

export function menuList(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/menu/list`,
    method: "get",
    params
  });
}

export function menuDetail(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/menu/detail`,
    method: "post",
    data
  });
}

export function menuAdd(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/menu/add`,
    method: "post",
    data
  });
}

export function menuUpdate(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/menu/edit`,
    method: "post",
    data
  });
}

export function menuDelete(data?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/menu/delete`,
    method: "post",
    data
  });
}

export function menuTree(params?: object) {
  return http({
    url: `/${EnumAlias.PROJECT}/${EnumAlias.MODULE_SYS}/menu/tree`,
    method: "get",
    params
  });
}
